using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using RSSRadio.Model;

namespace RSSRadio
{
	public partial class FeedViewerForm : Form
	{
		FeedViewer FeedView;

		public FeedViewerForm(Subscription feed)
		{
			if (feed == null)
				throw new ArgumentNullException();

			InitializeComponent();
			FeedView = new FeedViewer(feed);
			FeedView.Dock = DockStyle.Fill;
			this.Controls.Add(FeedView);
            FeedView.SelectedItemChanged += new EventHandler<EventArgs>(FeedView_SelectedItemChanged);
            MnuDownload.Enabled = FeedView.CanDownloadPodcast;
        }

		private void MnuDownload_Click(object sender, EventArgs e)
		{
			FeedView.DownloadSelectedItem();
		}

        private void FeedView_SelectedItemChanged(object Source, EventArgs e)
        {
            MnuDownload.Enabled = FeedView.CanDownloadPodcast;
        }
	}
}